package com.qianbao.qianbaobusiness.database;

import android.arch.persistence.room.Dao;
import android.arch.persistence.room.Delete;
import android.arch.persistence.room.Insert;
import android.arch.persistence.room.Query;

import com.qianbao.qianbaobusiness.json.PcdBean;

import java.util.List;

/**
 * @author: Routee
 * @date 2018/6/26
 * @mail wangc4@qianbaocard.com
 * ------------1.本类由Routee开发,阅读、修改时请勿随意修改代码排版格式后提交到git。
 * ------------2.阅读本类时，发现不合理请及时指正.
 * ------------3.如需在本类内部进行修改,请先联系Routee,若未经同意修改此类后造成损失本人概不负责。
 */
@Dao
public interface DistrictDao {
    @Query("SELECT * FROM districts")
    List<PcdBean.DistrictsBean> getAll();

    @Query("SELECT * FROM districts WHERE citycode = (:ids)")
    List<PcdBean.DistrictsBean> queryDistricts(String ids);

    @Insert
    void insertAll(PcdBean.DistrictsBean... districtsBeans);

    @Delete
    void delete(PcdBean.DistrictsBean citys);

    @Query("DELETE FROM districts")
    void deleteAll();
}
